#ifndef __NetWork_SERVER_H__
#define __NetWork_SERVER_H__

#include <mutex>
#include "Util/util.h"
#include "jsoncpp/json.h"
#include "Network/Buffer.h"
#include "Net.h"

using namespace std;
using namespace Fdt;

class NetWorkServer{
	public:
		static NetWorkServer *instance();	
		void RegistRPC();
		bool SetNetwork(const Json::Value &request, const Fdt::BufferMap::Ptr &inMap, Json::Value &response, Fdt::BufferMap::Ptr &outMap);

		bool GetNetwork(const Json::Value &request, const Fdt::BufferMap::Ptr &inMap, Json::Value &response, Fdt::BufferMap::Ptr &outMap);

		bool GetNetworkStatus(const Json::Value &request, const Fdt::BufferMap::Ptr &inMap, Json::Value &response, Fdt::BufferMap::Ptr &outMap);

	private:
		NetWorkServer();
		~NetWorkServer();
	private:
		static NetWorkServer *sm_netWorkServer;
		static mutex sm_netWorkServerLock;
};

#endif


